<?php

/**
 * Horario form.
 *
 * @package    cronos-doctrine
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormTemplate.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
 */
class HorarioForm extends BaseHorarioForm
{
  public function configure()
  {
      //Eliminar los campos del formularios  created_at y updated_at
      unset (
        $this['created_at'],
        $this['updated_at']

      );
      
      $this->widgetSchema['empresa_id'] = new sfWidgetFormInputHidden(array(),array('value'=> sfContext::getInstance()->getUser()->getAttribute('agente_user_empresa_id')));
      
      //Cambiar a inicial
      $this->widgetSchema['inicial'] = new sfWidgetFormTime(array(
          'minutes' => Horario::$minutos,
      ));

      //Cambiar a inicial
      $this->widgetSchema['final'] = new sfWidgetFormTime(array(
          'minutes' => Horario::$minutos,
      ));

      //Cambiar a lista y su validador de los Intervalos
      $this->widgetSchema['intervalo'] = new sfWidgetFormChoice(array(
         'choices' => Horario::$intervalo,
         'expanded' => false,
         'multiple' => false,

      ));

      $this->validatorSchema['intervalo'] = new sfValidatorChoice(array(
          'choices' => array_keys(Horario::$intervalo),

      ));

      //Cambiar a lista y su validador de los status Activo e Inativo 0/1
      $this->widgetSchema['sub_intervalo'] = new sfWidgetFormChoice(array(
         'choices' => Horario::$intervalo,
         'expanded' => false,
         'multiple' => false,

      ));

      $this->validatorSchema['sub_intervalo'] = new sfValidatorChoice(array(
          'choices' => array_keys(Horario::$intervalo),

      ));
  }
}
